/*
 * Project: BoboDesignPattern
 * 
 * File Created at 2019年2月2日
 * 
 * Copyright 2012 Greenline.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Greenline Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Greenline.com.
 */
package chainOfResp;

/**
 * @Type Director
 * @Desc
 * @author 52489
 * @date 2019年2月2日
 * @Version V1.0
 */
public class Director extends Leader {

    /**
     * @param name
     */
    public Director(String name) {
        super(name);
        // TODO Auto-generated constructor stub
    }

    /*
     * (non-Javadoc)
     * 
     * @see chainOfResp.Leader#handleRequest(chainOfResp.LeaveRequest)
     */
    @Override
    public void handleRequest(LeaveRequest leaveRequest) {
        if (leaveRequest.getLeaveDays() < 3) {
            System.out.println("员工：" + leaveRequest.getEmpName() + "请假：" + leaveRequest.getLeaveDays() + "原因："
                    + leaveRequest.getReason());
            System.out.println(this.getClass().getName() + "审批通过");
        } else {
            if (this.nextLeader != null) {
                this.nextLeader.handleRequest(leaveRequest);
            }
        }
    }

}
